from main.common.redis.redis_cli import RedisClientOrderContent
from main.common.redis.redis_keys import PURIFY_SUBORDERGEN_INSTANT_KEY


def add_purify_subordergen_instant(_id, purify_config_id, urgency_val, content_type_val):
    print(f'add_purify_subordergen_instant({_id}, {purify_config_id}, {urgency_val}, {content_type_val})')
    r_key = PURIFY_SUBORDERGEN_INSTANT_KEY.format(
        purify_config=purify_config_id, urgency_val=urgency_val, content_type_val=content_type_val)
    RedisClientOrderContent.lpush(r_key, _id)


def rpush_add_purify_subordergen_instant(_id, purify_config_id, urgency_val, content_type_val):
    print(f'add_purify_subordergen_instant({_id}, {purify_config_id}, {urgency_val}, {content_type_val})')
    r_key = PURIFY_SUBORDERGEN_INSTANT_KEY.format(
        purify_config=purify_config_id, urgency_val=urgency_val, content_type_val=content_type_val)
    RedisClientOrderContent.rpush(r_key, _id)


if __name__ == "__main__":

    add_purify_subordergen_instant(1, purify_config_id=1, urgency_val=1, content_type_val='text')
